package com.dataStructure.队列.优先级队列;

import com.dataStructure.堆.BinaryHeap;

import java.util.Comparator;

public class PriorityQueue<E> {

    public PriorityQueue(Comparator<E> comparator){
       BinaryHeap<E> heap =new BinaryHeap<>(comparator);
    }

    public PriorityQueue( ){
        this(null);
    }

    BinaryHeap<E> heap ;

    private int size;


    // 元素的数量
    public int size() {
        return heap.size();
    }

    // 是否为空
    public boolean isEmpty() {
        return heap.isEmpty();
    }

    // 清空
    public void clear() {
        heap.clear();
    }

    // 入队
    public void enQueue(E element) {
        heap.add(element);
    }

    // 出队
    public E deQueue() {
        return heap.remove();
    }

    //获取队列头元素
    public E front() {
        return heap.get();
    }
}
